	//하단링크
	function clsClubInc_Foot(){
		this._HTMLDom = null;
		this._init();
	}
	
	clsClubInc_Foot.prototype = {
		_init: function(){			
			this._HTMLDom = {
				"$layer": $("footer.depth_gnb nav ul li a")
			}
		}
		, $getBtnLink: function(){
			return this._HTMLDom["$layer"];
		}
	}
	
	//동호회정보
	function clsClubInc_Info(){
		this.listData = null;
		this.errorMsg = null;		
		this._ERRMSG = {
			"_NOMEMBER": 	"동호회에 가입되지 않은 회원은 이용하실 수 없습니다."
			, "_NOADMIN": "동호회 매니저(개설자)만 이용하실 수 있습니다."
			, "_NOVIEW": "동호회 회원만 볼 수 있는 게시글입니다."
		}			
		this._init();
	}
	
	clsClubInc_Info.prototype = {
		_init: function(){
			
		}
		, setData: function(thisData){
			this.listData = thisData;	
		}
		, getInfoData: function(){
			return this.listData;	
		}
		, isMember: function(){	//0-가입회원,1~9=비회원,							
			if(this.listData["가입여부"]=="0"){
				return true;	
			}else {
				this.errorMsg = this._ERRMSG["_NOMEMBER"];
				return false;
			}
			return false;
		}
		, isAdmin: function(){//0-일반회원,1-매니저/관리자
			if(this.listData["내상태"]=="1"){
				return true;	
			}else {
				this.errorMsg = this._ERRMSG["_NOADMIN"];
				return false;
			}
			return false;
		}
		, isOpenView: function(viewType){
			if(viewType == "C"){//A-모두공개,C-회원공개
				if(!this.isMember()){
					this.errorMsg = this._ERRMSG["_NOVIEW"];
					return false;
				}
				return true;
			}
			return true;
		}
		, getError: function(){
			return this.errorMsg;	
		}
		, getInfoData: function(){
			return this.listData;	
		}
	}
	
	//통신
	function clsClubInc_Comm(){
		this.clubInfo = null;
		this.clubInfoRequest = null;		
		this.clubMyList = null;
		this._init();
	}
	
	clsClubInc_Comm.prototype = {
		_init: function(){
			this.clubInfoRequest = {
				"동호회키": null
				, "동호회명": null
			}
		}
//------------------------ 동호회기본정보------------------------//		
		, getClubInfo: function(arg){
			var thisClass = this;
			var club_seq = _gf.CLUB_DATA["동호회키"];
			
			arg = arg || {};
			
			var objJson = new MJson();
        	var cm = new ConnectionManager();
			
			objJson.putClient("userid", _util.getLogin("아이디"));
        	objJson.putPub("sid", "CL001");
        	objJson.putPub("servicename", "getClubInfo");   
			objJson.putParameter("clubSeq", club_seq);      
		
        	cm.requestGet(objJson.getJsonString(), function(ret){
        		
        		var arr = {};
        		var res = {
					"결과코드": ret["msp"]["contents"]["serviceResult"]
					, "메시지": _util.getResultMsg(ret)
				}
				
				
				var items = ret["msp"]["contents"]["items"];
				if(items){					
					//동호회목록					
					arr = {
						"동호회명": _util.nvl(items["clubName"])
						, "동호회키": _util.nvl(items["clubSeq"])
						, "스킨이미지": _util.nvl(items["skinUrl"])
						, "가입자수": _util.nvl(items["memberCnt"])
						, "글수": _util.nvl(items["totalBoardCnt"])
						, "개설일": _util.nvl(items["regDate"])
						, "개설요일": _util.nvl(items["regDay"])
						, "가입여부": _util.nvl(items["clubMember"]["memberStatus"])
						, "가입질문": _util.nvl(items["acceptQuestion"])
						, "가입유형": _util.nvl(items["acceptYn"]) //Y-승인후가입, N-미승인
						, "내상태": _util.nvl(items["clubMember"]["adminFlag"])
						, "동호회소개": _util.nvl(items["clubDesc"])
						, "키워드":_util.nvl(items["clubKeyword"])
						, "카테고리": {
							"카테고리키" : _util.nvl(items["clubCategoryMaster"]["categoryId"])
							,"카테고리명" :_util.nvl(items["clubCategoryMaster"]["categoryName"])
						}
						, "파일":{							
							 "상단파일": {
								 "파일키": _util.nvl(items["skinFileSeq"])
								, "섬네일": "NOT"
								, "파일명": _util.nvl(items["skinUrl"])
								, "원본파일명": "NOT"
							}
							, "배너파일": {
								"파일키": _util.nvl(items["bannerFileSeq"])
								, "섬네일": "NOT"
								, "파일명": _util.nvl(items["bannerUrl"])
								, "원본파일명": "NOT"
							}
							, "로고파일": {
								"파일키": _util.nvl(items["logoFileSeq"])
								, "섬네일": "NOT"
								, "파일명": _util.nvl(items["logoUrl"])
								, "원본파일명": "NOT"
							}
						}
						, "상단스킨": _util.nvl(items["skinUrl"])
						, "배너이미지": _util.nvl(items["bannerUrl"])
						, "로고이미지": _util.nvl(items["logoUrl"])
						, "상단스킨구분": _util.nvl(items["skinGb"])
						, "배너이미지구분": _util.nvl(items["bannerGb"])
						, "로고이미지구분": _util.nvl(items["logoGb"])
						, "클럽장": {
							"아이디": _util.nvl(items["userMaster"]["userId"])
							, "닉네임":	_util.nvl(items["userMaster"]["nickname"])
							, "이미지": _util.nvl(items["userMaster"]["path"]) + _util.nvl(items["userMaster"]["saveFileName"])
							, "성별": _util.nvl(items["userMaster"]["sex"])
							, "핸디": _util.nvl(items["userMaster"]["handi"])
							, "비거리": _util.nvl(items["userMaster"]["region"])
						}
					};				
				}
				$(thisClass).trigger("evtFinishClubInfo", arr);		
        		arg["콜백"].apply(null, [res, arr, arg]);
        	}, function($err) {
				alert($err);
			});			
		}
//------------------------ 동호회기본정보------------------------//					
	}


	
	function clsClubInc_Control(){
		this.club_seq = null;
		this.objClubIncFoot = null;
		this.objClubInc_Info = null;
		this.objClubInc_Comm = null;
		
		this._init();
	}
	
	clsClubInc_Control.prototype = {
		_init: function(){
			this.objClubIncFoot = new clsClubInc_Foot();			
			this.objClubInc_Info = new clsClubInc_Info();
			this.objClubInc_Comm = new clsClubInc_Comm();
			
			this.getParam();
			
			this._bind();
			this._eventFinish();
			
			//동호회정보조회
			//this.objClubInc_Comm.setClubInfoRequest("동호회키",this.club_seq); 
			//this.objClubInc_Comm.getClubInfo();
		}	
		, getParam: function(){			
			this.club_seq = _gf.CLUB_DATA["동호회키"];	
		}
		, _bind: function(){
			var thisClass = this;
			
			//일반메뉴 링크
			this.objClubIncFoot.$getBtnLink().click(function(event){
				event.preventDefault();						
				var _url = "";				
				var s = $(this).attr("class");
				
				if(s.indexOf("icoN4")>-1){
					_url = "self_club.html"; 
				}else if(s.indexOf("icoN5")>-1){
					_url = "club_board.html"; 
				}else if(s.indexOf("icoN6")>-1){
					_url = "club_album.html"; 
				}else if(s.indexOf("icoN7")>-1){
					_url = "club_round.html"; 
				}else if(s.indexOf("icoN8")>-1){
					_url = "club_control.html"; 
				}else if(s.indexOf("icoN9")>-1){
					_url = "club_agree.html"; 
				}else if(s.indexOf("icoN10")>-1){
					_url = "club_letter.html"; 
				}else {
					return;	
				}
				_gf.CLUB_DATA["내글"] = "";
				$.mobile.changePage(_url,"slide",true);
			});			
		}
		, _eventFinish: function(){
			var thisClass = this;
			
			// 동호회정보 조회 완료이벤트
			$(this.objClubInc_Comm).bind("evtFinishClubInfo", function(event, resData){				
				thisClass.objClubInc_Info.setData(resData);
			});
		}
		, getClubInfoData: function(arg){
			this.objClubInc_Comm.getClubInfo(arg);
		}
		, getClubInfo: function(){
			return this.objClubInc_Info;	
		}
	}
		
	_cb = new clsClubInc_Control();